package com.lazycat.backend.controller.account;

import com.lazycat.backend.service.impl.account.UserRegisterServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Base64;
import java.util.Map;

//用户注册接口

@RestController
public class UserRegisterController {

    @Autowired
    private UserRegisterServiceImpl registerService;

    @PostMapping( "user/register/")
    public Map<String, String> register(@RequestBody Map<String,String> map) {
        String username = map.get("username");
        String password = map.get("password");
        String confirmedPassword = map.get("confirmedPassword");
        String img = map.get("img");
        System.out.println(username);
        System.out.println(password);
        System.out.println(confirmedPassword);
        return registerService.register(username, password, confirmedPassword, img);
    }
}
